<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/1/22 0022
 * Time: 上午 10:09
 */
namespace app\api\service;

use app\admin\model\Rechargerecord;

class Detailed{
    /**
     * 插入明细
     */
    //插入余额消费明细
    public static function insertDetailed($order,$type=1){
        $model = new Rechargerecord();
        $model->order_no = $order->order_no;
        $model->record_money = $order->total;
        $model->member_id = $order->member_id;
        if($type == 2){
            $model->type = 3;
            $model->detail = '订单退款';
        }else{
            $model->type = 2;
            $model->detail = '订单余额支付';
        }
        $model->pay_method = 3;
        $model->status = 1;
        $model->save();
    }
}